export function setCache(key,value) {
  window.localStorage.setItem(key,JSON.stringify(value))
}

export function getCache(key) {
  // obj => string
 const value =  window.localStorage.getItem(key)
  if (value) {
    // string =>obj
    return JSON.parse(value)
  }
}

export function removeCache(key) {
  window.localStorage.removeItem(key)
}

export function clearCache() {
  window.localStorage.clear()
}